REST endpoint for searching Gerrit documentation. The documentation of this endpoint is available in rest-api-docsearch[.txt|.html]. The UI of showing the search result and doing the search will be in a separate change. Change-Id: Ifa4f5a7d576ada7f88a4fa1b765a38cba6d7e964 
diff --git a/Documentation/rest-api-documentation.txt b/Documentation/rest-api-documentation.txt new file mode 100644 index 0000000..db7dc35 --- /dev/null +++ b/Documentation/rest-api-documentation.txt 
@@ -0,0 +1,151 @@ +Gerrit Code Review - /Documentation/ REST API +============================================= + +This page describes the documentation search related REST endpoints. +Please also take note of the general information on the +link:rest-api.html[REST API]. + +Please note that this feature is only usable with documentation built-in. +You'll need to +`buck build :withdocs` +or +`buck build :release` +to test this feature. + +[[documentation-endpoints]] +Documentation Search Endpoints +------------------------------ + +[[search-documentation]] +Search Documentation +~~~~~~~~~~~~~~~~~~~~ +[verse] +'GET /Documentation/' + +With `q` parameter, search our documentation index for the terms. + +A list of link:#doc-result[DocResult] entities is returned describing the +results. + +.Request +---- + GET /Documentation/?q=test HTTP/1.0 +---- + +.Response +---- + HTTP/1.1 200 OK + Content-Disposition: attachment + Content-Type: application/json; charset=UTF-8 + + )]}' + [ + { + "title": "Gerrit Code Review - REST API Developers\u0027 Notes", + "url": "Documentation/dev-rest-api.html" + }, + { + "title": "Gerrit Code Review - REST API", + "url": "Documentation/rest-api.html" + }, + { + "title": "Gerrit Code Review - JavaScript API", + "url": "Documentation/js-api.html" + }, + { + "title": "Gerrit Code Review - /plugins/ REST API", + "url": "Documentation/rest-api-plugins.html" + }, + { + "title": "Gerrit Code Review - /config/ REST API", + "url": "Documentation/rest-api-config.html" + }, + { + "title": "Gerrit Code Review for Git", + "url": "Documentation/index.html" + }, + { + "title": "Gerrit Code Review - /access/ REST API", + "url": "Documentation/rest-api-access.html" + }, + { + "title": "Gerrit Code Review - Plugin Development", + "url": "Documentation/dev-plugins.html" + }, + { + "title": "Gerrit Code Review - Developer Setup", + "url": "Documentation/dev-readme.html" + }, + { + "title": "Gerrit Code Review - Hooks", + "url": "Documentation/config-hooks.html" + }, + { + "title": "Change Screen - Introduction", + "url": "Documentation/intro-change-screen.html" + }, + { + "title": "Gerrit Code Review - /groups/ REST API", + "url": "Documentation/rest-api-groups.html" + }, + { + "title": "Gerrit Code Review - /accounts/ REST API", + "url": "Documentation/rest-api-accounts.html" + }, + { + "title": "Gerrit Code Review - /projects/ REST API", + "url": "Documentation/rest-api-documentation.html" + }, + { + "title": "Gerrit Code Review - /projects/ REST API", + "url": "Documentation/rest-api-projects.html" + }, + { + "title": "Gerrit Code Review - Prolog Submit Rules Cookbook", + "url": "Documentation/prolog-cookbook.html" + }, + { + "title": "Gerrit Code Review - /changes/ REST API", + "url": "Documentation/rest-api-changes.html" + }, + { + "title": "Gerrit Code Review - Configuration", + "url": "Documentation/config-gerrit.html" + }, + { + "title": "Gerrit Code Review - Access Controls", + "url": "Documentation/access-control.html" + }, + { + "title": "Gerrit Code Review - Licenses", + "url": "Documentation/licenses.html" + } + ] +---- + +.Query documentation +**** +get::/Documentation/?q=keyword +**** + + +[[json-entities]] +JSON Entities +------------- + +[[doc-result]] +DocResult +~~~~~~~~~ +The `DocResult` entity contains information about a document. + +[options="header",width="50%",cols="1,^2,4"] +|========================= +|Field Name ||Description +|`title` ||The title of the document. +|`url` ||The URL of the document. +|========================= + + +GERRIT +------ +Part of link:index.html[Gerrit Code Review]